package com.magicsoft.share.adapter.my;

import android.support.annotation.LayoutRes;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.my.OrderList;
import com.magicsoft.share.utils.DensityUtils;
import com.yanzhenjie.recyclerview.swipe.widget.DefaultItemDecoration;

/**
 * Created by lyf on 2017/11/7/007.
 */

public class OrderCompletAdapter extends BaseQuickAdapter<OrderList.ListBean, BaseViewHolder> {


    public OrderCompletAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderList.ListBean item) {
        RecyclerView recyclerView =  helper.getView(R.id.recyclerView);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        recyclerView.addItemDecoration(new DefaultItemDecoration(mContext.getResources().getColor(R.color.bg), 0, DensityUtils.dp2px(mContext, 0.5f)));


        OrderGoodsAdapter orderGoodsAdapter = new OrderGoodsAdapter(R.layout.item_order, item.getGoodsList());
        recyclerView.setAdapter(orderGoodsAdapter);

    }
}
